<template>
  <div style="height:750px">
    <div>
      <el-form ref="form" :model="form" style="width:1200px;margin:0 auto" label-width="80px">
        <el-form-item label="问题标题：" label-width="100px">
          <el-input v-model="form.title" style="width:300px"></el-input>
        </el-form-item>
        <el-form-item label="客户姓名：" label-width="100px">
          <el-input v-model="form.userName" :disabled="true" style="width:300px"></el-input>
        </el-form-item>
        <el-form-item label="问题描述">
          <el-input
            type="textarea"
            :autosize="{ minRows: 6, maxRows: 9 }"
            v-model="form.problemDescription"
          ></el-input>
        </el-form-item>
        <el-form-item label="手机号：" label-width="100px">
          <el-input v-model="form.phone" style="width:300px"></el-input>
        </el-form-item>

           <el-form-item label="联系地址：" label-width="100px">
          <el-input v-model="form.addr" style="width:300px"></el-input>
        </el-form-item>

        <el-form-item>
          <el-button type="primary" @click="onSubmit">提交</el-button>
          <el-button>取消</el-button>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      form: {
        userName: this.$store.state.user.username,
        title: "",
        problemDescription: "",
        phone: "",
        prolemstate: 0,
        addr:''
      },
    };
  },
  methods: {
    onSubmit() {
      this.$axios({
        method: "post",
        data: this.form,
        url: "/older/savequestion",
      })
        .then((res) => {
          if (res.data.code == 200) {
            this.$router.push({
              path: "/Notaccepted",
            });
            this.$message.success("上诉问题成功");
          }
        })
        .catch((error) => {
          console.log(error);
        });
    },
  },
};
</script>

<style></style>
